package com.alibaba.algo.enums;

import cn.hutool.crypto.SmUtil;
import lombok.Getter;

/**
 * @author fan.tianpeng
 * @date 2021/5/13 15:22
 */
@Getter
public enum SysUserPassWdSaltEnum {

    SALT("CTSW_USER_SALT"),
    ;

    private String value;

    SysUserPassWdSaltEnum(String value) {
        this.value = value;
    }

    /**
     * 加密密码
     *
     * @param passWd 密码
     * @return 密文密码
     */
    public static String encrypt(String passWd) {
        return SmUtil.sm3(passWd + SALT.getValue());
    }
    
    public static void main(String[] args) {
		System.out.println(encrypt("123456"));
	}
}
